<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>评估条件值</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>static/h-ui.admin/css/style.css" />
<script
	src="<%=basePath%>lib/jquery.SuperSlide/2.1.1/jquery.SuperSlide.min.js"
	type="text/javascript"></script>
<script src="<%=basePath%>lib/jquery/1.9.1/jquery.min.js"
	type="text/javascript"></script>
</head>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
}

body {
	width: auto;
	height: auto;
}

tr{width:100%;}

td {
	
	height:40px;
	line-height: 30px;
	font-size:16px;
	border:1px solid #ddd;
}

.active{
 background:gray;

}


.info_con {
	width: 541px;
	height: 322px;
	color: #23455;
	font-size: 18px;
	font-family: "宋体";
	padding: 0;
	margin: 0;
	position: relative;
	top: 20px;
	left: 50px;
	right: auto;
	bottom: 0;
	text-align: center;
}

.h_css {
	width:585px;
	height: 30px;
	background: #e9e7e1e6;
	margin-top: 10px;
	text-align: left;
	padding-left: 48px;
	line-height: 30px;
	font-size: 12px;
	font-family: normal;
}

/* .tab_css {
	background-color: #ccc;
} */

.tab_css td {
	background-color: #fcfcfc;
}
.slider_con{
  width: 541px;
  height:240px;
  margin-left:50px;

}
.img_con{
 width:240px;
 height:240px;
 position:relative;
 margin:auto;
 right:0;
 left:0;
 bottom:0;
}

table{border:1px solid #ddd;}
</style>
<body>

	<div class="info_con">

		<table class="tab_css" border="1" cellpadding="0" cellspacing="1">
				<tr>
			<td>序号</td>
			<td>评估属性名称</td>
			<td width="60">操作</td>
			</tr>
			<c:forEach items="${bas }" var ="s">
		 <tr>
			<td>${s.assess_id }</td>
			<td>${s.assessname}</td>
			 <td width="60"><button class="btn_css" title="删除" style="cursor:pointer;" onclick="deleteAssess(this,${s.assess_id})"><i class="Hui-iconfont">&#xe6e2;</i></button></td>
		</tr>
			</c:forEach>
		</table>
	</div>

	<script type="text/javascript">
	$(function(){
		$("table").find("tr").each(function(){
			$(this).on("mouseover",function(){
				$(this).find("td").css("background","#f5f5f5");
			}).on("mouseleave",function(){
				$(this).find("td").css("background","#fcfcfc");
			})	
		});
		
	});
	
	//检测品牌下是否存在型号 若存在则不能删除 否则可以删除
	function deleteAssess(obj,assess_id){
		$.ajax({
			url:"checkAssessExsit",//查询该评估属性下有没有评估条件
		     data:{
		    	 assess_id:assess_id
		     },
		     type:"post",
		     dataType:"json",
			success:function(rs){
				if(rs){
				$.ajax({
					url:"deleteAssess",//删除评估属性
				     data:{
				    	 assess_id:assess_id
				     },
				     type:"post",
				     dataType:"json",
					success:function(){
						$(obj).parents("tr").remove();
						layer.alert("删除成功！");
					}
				});
				
				}else{
				alert("该评估属性已经存在评估值，不能删除！");	
					
				}
			}
		});	
		
	}
	</script>
</body>
</html>